import { IsString, IsDate, IsEnum, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class UpdateSemesterDto {
    @ApiProperty({ description: '学期名称', example: '2023-2024学年第二学期', required: false })
    @IsString()
    @IsOptional()
    name?: string;

    @ApiProperty({ description: '开始日期', example: '2024-02-26', required: false })
    @IsDate()
    @IsOptional()
    startDate?: Date;

    @ApiProperty({ description: '结束日期', example: '2024-07-15', required: false })
    @IsDate()
    @IsOptional()
    end_date?: Date;

    @ApiProperty({ 
        description: '学期状态', 
        enum: ['planned', 'current', 'completed'],
        example: 'current',
        required: false
    })
    @IsEnum(['planned', 'current', 'completed'])
    @IsOptional()
    status?: string;
}
